package com.model;

import java.net.URL;

public class UploadResponse {
    private boolean status;
    private String message;
    private Data data;

    // Getters and setters for each field
    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Data getData() {
        return data;
    }

    public void setData(Data data) {
        this.data = data;
    }

    // Inner class for the 'data' object
    public static class Data {
        private String key;
        private String name;
        private String pathname;
        private String originname;
        private String size;
        private String mimetype;
        private String extension;
        private String md5;
        private String sha1;
        private Links links;

        // Getters and setters for each field
        // ... (similar to the UploadResponse class)

        public String getKey() {
            return key;
        }

        public void setKey(String key) {
            this.key = key;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        // ... (other getters and setters)

        public Links getLinks() {
            return links;
        }

        public void setLinks(Links links) {
            this.links = links;
        }

        // Inner class for the 'links' object
        public static class Links {
            private URL url;
            private String html;
            private String bbcode;
            private String markdown;
            private String markdownwithlink;
            private URL thumbnailurl;
            private URL deleteurl;

            // Getters and setters for each field
            public URL getUrl() {
                return url;
            }

            public void setUrl(URL url) {
                this.url = url;
            }

            public String getHtml() {
                return html;
            }

            public void setHtml(String html) {
                this.html = html;
            }

            // ... (other getters and setters)
        }
    }

    // Main method to create an instance of UploadResponse
    public static void main(String[] args) {
        UploadResponse response = new UploadResponse();
        response.setStatus(true);
        response.setMessage("上传成功");

        UploadResponse.Data data = new UploadResponse.Data();
        data.setKey("t5O6J6");
        data.setName("67e7758507eca.jpg");
        // ... (set other fields)

        UploadResponse.Data.Links links = new UploadResponse.Data.Links();
        try {
            links.setUrl(new URL("https://img.picui.cn/free/2025/03/29/67e7758507eca.jpg"));
            // ... (set other fields)
        } catch (Exception e) {
            e.printStackTrace();
        }

        data.setLinks(links);
        response.setData(data);

        // Now you have an object 'response' that represents the JSON data
    }
}
